package practice.test3.studentRecord.plan2;

import org.apache.hadoop.io.Text;

public class ScoreRecordParser {
    private String id;
    private String name;
    private String score;

    public boolean parse(String line){
        String[] strs=line.split("[|]");
        if(strs.length<3){
            return false;
        }
        id=strs[0].trim();
        name=strs[1].trim();
        score=strs[2].trim();
        if(id.length()>0&&name.length()>0&&score.length()>0){
            return true;
        }else{
            return false;
        }
    }

    public boolean parse(Text line){
        return parse(line.toString());
    }

    public String getId(){
        return id;
    }

    public void setId(String id){
        this.id=id;
    }

    public String getName(){
        return name;
    }

    public void setName(String name){
        this.name=name;
    }

    public String getScore(){
        return score;
    }

    public void setScore(String score){
        this.score=score;
    }
}
